How To Add A New User In The WordPress Database

How To Add A New User In The WordPress Database Using PhpMyAdmin?

You should know that you can manually add a new user in the database of your website. If someone hacks your website then it is possible that you won’t be able to login into your WordPress dashboard. At that time, you will in need to have a new username and password to log in.

If you can login into the WordPress then for safety you can change the username and password using cPanel. But here we are talking about to create a new database user.

It is always recommended that when you do any change with your website, you should have the full backup of your website. Here we are talking about the database so, have the backup of your database in your computer.

How Can You Add A New User In The WordPress Database?

When people read about using cPanel then it doesn’t seem good for them. I have met many bloggers who don’t prefer to mess with the cPanel of their web hosting account. But here it is necessary to do it. It is a serious issue. You should keep your website safe.

If you forget your WordPress username or some hacks your website and change the password then you have to add a new user in the database to login into your website.

Steps To Create A New Database User:

There are some steps to follow to add a new user in the database of your website. You have to follow these steps for the completion of your task.

Step 1:- Like always, login into your web hosting account and open the cPanel. Search for databases and click at “phpMyAdmin”. A new tab will open in front of you in your current window.

Step 2:- Now in the left-hand menu you have to click the database you want to edit. A table will be shown to you from which you just need to find “wp_users” to edit. Click to it and you will see some option in the main area.

Step 3:- Click to “Insert” option and many fields will be shown to you. You have to fill those boxes.

  • ID : You can choose any number you want. But remember the ID. You will need it later. Here I am selecting ID as 2.
  • user_login : Here you have to type the username using which you want to login into your WordPress. Choose it wisely and don’t tell it to anyone else.
  • user_pass : Password is needed for the username you have added in the previous field. Use MD5 option in front of the value.
  • user_nicename : It can be anything you want.
  • user_email : An email is required for this account. You can get all the information of this account to your email address. You have to attach an email here.
  • user_url : It should be the URL of your website.
  • user_registered : You have to fill the date here. You can fill the date of the day you create a new database user.
  • user_activation_key : Leave it blank.
  • user_status : Fill it “0”.
  • display_name : Fill the name you want to display this user at your website. Most of the time people use their user_nicename as their display_name.

Click to “go” button. Now you have to two rows in “wp_usermeta”.

Step 4 :- Again from the table in the left-hand-side, click at “wp_usermeta“. Like you have done it before, similarly, click to “Insert” option and some blank fields will be shown to you.

  • unmeta_id : Leave it blank. It will be generated automatically.
  • user_id : Remember the ID you have filled earlier. Fill it “2” again.
  • meta_key : Fill it “wp_capabilities“.
  • meta_value : Place this – a : 1 :{s:13:”administrator”;s:1:”1″;}

Click to “go” button, but you are not done yet. You have to add another row in “wp_usermeta“.

Step 5 :- Again click to “Insert” option. Fill the options again same as before.

  • unmeta_id : Leave it blank.
  • user_id : Same as before. Remember we have filled it “2” in the previous step.
  • meta_key : Here is the change. You have to fill “wp_user_level“.
  • meta_vale : Fill it “10”.

Click to the “go” button and you have successfully added a new user in the database of your website.

Step 6 :- Now go and login into the WordPress with the username and the password you have filled above. Now go to your WordPress dashboard>>users>>your profile after editing, save the options. You don’t need to change anything here. Just click the save button. You can add extra fields if you want to.

Are You In Need To Add A New User In The WordPress Database?

If you are in need to create a new database user then this tutorial for you. Hard time may come to anyone. If you face such kind of problem then you can easily get rid of it. You just have to add a new user in the database and you are done.

Now you know how to login into the WordPress if someone changes your username and password. I am sure you wouldn’t take any kind of risk. So, be safe and keep blogging.

by Ravi Chahar

A WordPress Professional and the LinkedIn Influencer. A coder by passion and a blogger by choice. WordPress theme development is his forte. He is your WordPress guy who will teach you how to solve WordPress errors, WordPress security issues, design issues and what not.


Get Free Updates Into Your Inbox

Learn Everything Just Like I Did

SUBSCRIBE



4 comments

  1. Hi Ravi,

    You are amazing with the tutorials you have been giving us. This one is excellent. I can actually understand something that was so foreign to me. You put things together so well and easy for us to apply. I thank you for that.

    As I visit you lately, I keep thinking that if you took all these blog posts together and put it in an ebook or e course it would be a great reference book. Just say’n….

    -Donna

    1. Hey Donna,

      Thanks for appreciating.:) It means a lot to me.

      You know I have faced a lot of problems in my starting days and I don’t anyone else to face those problems. I have searched a lot about simple tutorials for beginners but failed.

      Now I am just trying to provide quality content to people so that they can learn more about WordPress. Easy going tutorials are necessary during starting phase.

      Actually I don’t get much time to spend at my website. I am just trying to manage it. And for sure I will combine all the tutorials in an ebook. But only if I get time. This can be done only after my graduation.

      Thanks for your suggestion.

      Have a lovely day.

      ~Ravi

  2. This is a great tutorial Ravi,

    There are indeed so many things you can don on your blog via the Phpmyadmin of your cpanel and i never knew you can also add more users to your blog through this means.

    However, i think its always easier to do this through your wordpress user admin to avoid messing things up on your cpanel, this is especially for people that has no much knowledge on how to nagivate around the cpanel.

    1. Hi Theodore,

      You can do a lot of things with your website using the cPanel.

      But most of the bloggers don’t have much knowledge about techie things. I agree with you that people who are not tech savvy should add users from their admin panel only. And what if you are not allowed to login into your WordPress dashboard?

      During such difficult time you can create a new user in the database. You can login with your new username and password.

      Thanks for your contribution.

      Rock your day.

      ~Ravi

Leave a Reply

Your email address will not be published. Required fields are marked *